import * as req from '@/request';

/** 登录接口 POST /account/login */
export async function login(data: API.LoginRequest) {
    // return req.postForm<API.LoginResult>('/account/loginx', data, { skipError: true });
    return req.postForm<API.LoginResult>('/account/login', data);
}

/** 退出登录接口 POST /account/logout */
export async function logout() {
    //await utils.waitTime(3000);
    return req.post<API.Result>('/account/logout');
}

/** 获取当前的用户 GET /api/currentUser */
export async function currentUser() {
    //await req.waitTime(3000);
    return req.get<API.LoginResult>('/account/currentUser');
}

export async function changePsw(data: { oldPsw: string, newPsw: string }) {
  return req.post<API.Result>('/account/changepsw', data);
}


